<?php
namespace app\index\controller;
class Contact extends Base
{
  public function index(){
    return view();
  }

  public function add(){
    if(request()->isAjax()){
      $data = input('post.');
      if($data){
        if(db('user')->insert($data)){
          $back = [
            'statu' => 200,
            'info'  => "添加成功"
          ];
        }else{
          $back = [
            'statu' => 400,
            'info'  => "添加失败"
          ];
        }
      }
      return $back;
    }
  }
  
  
}
?>